CONST_CHIP_STACK = 10000

if class==nil then require 'class' end

require 'hand'
require 'card'

if Player == nil then Player = class({}) end

function Player:constructor(name, buyInAmount)
	self.name = name or "local"
	if self.name == "" then self.name = "local" end
	self.chipStack = CONST_CHIP_STACK
	self.amountInPot = 0
	self.amountContributed = 0
	self.initialStack = ChipStack
	self.folded = false
	self.message = "No decision has been made"
	self.simplifiedMessage = ""
	self.isbusted = false
	self.myHand = Hand()
end

function Player:GetAmountToCall(mainPot)
	return mainPot:GetMaximumAmountPutIn() - amountInPot
end


-- boring getters and setters
function Player:GetName()
	return self.name
end
function Player:SetName(name)
	self.name = name
end
function Player:GetChipStack()
	return self.chipStack
end
function Player:SetChipStack(val)
	if val < 0 then val = 0 end
	self.chipStack = val
	self:OnPropertyChanged("ChipStack", val)
end
function Player:GetAmountInPot()
	return self.amountInPot
end
function Player:SetAmountInPot(val)
	if val < 0 then val = 0 end
	self.amountInPot = val
end
function Player:GetAmountContributed()
	return self.amountContributed
end
function Player:SetAmountContributed(val)
	self.amountContributed = val
end
function Player:GetInitialStack()
	return self.initialStack
end
function Player:SetInitialStack(val)
	if val < 0 then val = 0 end
	self.initialStack = val
end
function Player:GetMessage()
	return self.message
end
function Player:SetMessage(val)
	self.message = message
end
function Player:GetSimplifiedMessage()
	return self.simplifiedMessage
end
function Player:SetSimplifiedMessage(val)
	self.simplifiedMessage = val
	self:OnPropertyChanged("SimplifiedChanged", val)
end